/*
 * OOStdEx.h
 *
 *  Created on: 2011-11-19
 *      Author: Jesse Meng [pingf0@gmail.com]
 */

#ifndef OOSTDEX_H_
#define OOSTDEX_H_
#include "OOCfg.h"
#include "OOBase.h"
#include "OOBase2.h"

#define NEW_PV __OOC_FUNCTION__CLASS_PRIVATE_NEW
#define DEL_PV __OOC_FUNCTION__CLASS_PRIVATE_DEL

#define PV(p) ((void *)__OOC_CLASS__PRIVATE(p))
#define PVT(p,Type) ((Type *)__OOC_CLASS__PRIVATE(p))

#define BDC(p) ((void *)((unsigned char *)p+__OOC_CLASS__ROOT_HEAD_SIZE))
#define BDS(p) ((void *)(unsigned char *)p+__OOC_STATIC__ROOT_HEAD_SIZE))
#define BDCS(p) ((void *)(unsigned char *)(ST(p))+__OOC_STATIC__ROOT_HEAD_SIZE))
#define BDCT(p,Type) ((Type *)((unsigned char *)p+__OOC_CLASS__ROOT_HEAD_SIZE))
#define BDST(p,Type) ((Type *)((unsigned char *)p+__OOC_STATIC__ROOT_HEAD_SIZE))
#define BDCST(p,Type) ((Type *)((unsigned char *)(ST(p))+__OOC_STATIC__ROOT_HEAD_SIZE))
#define BDCT_TP(p,Type)  BDCT(p,_##Type)
#define BDST_TP(p,Type)  BDST(p,_##Type)
#define BDCST_TP(p,Type) BDCST(p,_##Type)

#define BD BDC


#define CLASS_TP __OOC_CLASS__TEMPLATE_DESIGN
#define CLASS_TP_EX __OOC_CLASS__TEMPLATE_EXTENDED_FROM
#define CLASS_BIND __OOC_CLASS__BIND_TEMPLATE
#define CLASS_BIND_PREFIX __OOC_CLASS__BIND_PREFIX
#define CLASS_BIND_SUFFIX __OOC_CLASS__BIND_SUFFIX

#define CLASS_ST __OOC_CLASS__STATIC_DESIGN
#define CLASS_ST_EX __OOC_CLASS__STATIC_AND_EXTENDED_DESIGN

#define ASM_TP __OOC_ASSEMBLE__TEMPLATE
#define ASM_TP_EX __OOC_ASSEMBLE__EXTENDED_TEMPLATE

#define ASM_BIND __OOC_ASSEMBLE__BIND_TEMPLATE

#define ASM_C0S0 __OOC_ASSEMBLE__C0S0
#define ASM_C0S1 __OOC_ASSEMBLE__C0S1
#define ASM_C1S0 __OOC_ASSEMBLE__C1S0
#define ASM_C1S1 __OOC_ASSEMBLE__C1S1
#endif /* OOSTDEX_H_ */
